<template>
	<view class="page" :style="themeColor">
		<view class="flex benben-position-layout flex flex-wrap align-center myInformation_flex_0"
			:style="{ height: (88 + StatusBarRpx) + 'rpx', paddingTop: StatusBarRpx + 'rpx' }">
			<view class='flex flex-wrap align-center justify-between flex-sub myInformation_fd0_0'>
				<view class='flex flex-wrap align-center justify-center myInformation_fd0_0_c0'
					@tap.stop="handleJumpDiy" data-type="back" data-url="1">
					<text class='fu-iconfont2  myInformation_fd0_0_c0_c0'>&#xE794;</text>
				</view>
				<view class='flex flex-wrap align-stretch justify-center'>
					<text class='myInformation_fd0_0_c1_c0'>我的资料</text>
				</view>
				<view class='flex flex-wrap align-center myInformation_fd0_0_c2' v-if="!isSet" @tap.stop="setFunc()">
					<text class='myInformation_fd0_0_c2_c0'>编辑</text>
				</view>
				<view class='flex flex-wrap align-center myInformation_fd0_0_c2' v-else @tap.stop="setUserInfoFunc()">
					<text class='myInformation_fd0_0_c2_c0'>完成</text>
				</view>
			</view>

		</view>
		<view :style="{ height: (88 + StatusBarRpx) + 'rpx' }"></view>

		<view class="flex flex-direction flex-wrap align-stretch myInformation_flex_1">
			<view class='flex flex-wrap align-center justify-between myInformation_fd1_0'>
				<text class='myInformation_fd1_0_c0'>头像</text>
				<view class="upload position-relative flex flex-wrap align-center">

					<image v-if="isSet" class=" myInformation_fd1_0_c1_image" mode="aspectFill"
						@tap="croppingUploadImage('avatar', 'avatar', userInfo, userInfo)" :src="userInfo.avatar">
					</image>
					<!-- <image class=" myInformation_fd1_0_c1_c0_image" mode="aspectFit"
						@tap="croppingUploadImage('head_img','head_img',dataDetails,dataDetails)"
						:src="dataDetails.head_img ? dataDetails.head_img : STATIC_URL+'86.png'"></image> -->
					<image v-else class=" myInformation_fd1_0_c1_image" mode="aspectFill" :src="userInfo.avatar">
					</image>
					<text class='fu-iconfont2  myInformation_fd1_1_c1_c1' v-if="isSet">&#xE78E;</text>
				</view>

			</view>
			<view class='flex flex-wrap align-center justify-between myInformation_fd1_0' @tap.stop="openSex">
				<text class='myInformation_fd1_0_c0'>性别</text>
				<view class='flex flex-wrap align-center'>
					<text class='myInformation_fd1_1_c1_c0'
						v-if="userInfo.gender != '1' && userInfo.gender != '2' && userInfo.gender != '0'">请选择性别</text>
					<text class='myInformation_fd1_1_c1_c0_1' v-if="userInfo.gender == '0'">保密</text>
					<text class='myInformation_fd1_1_c1_c0_1' v-if="userInfo.gender == '1'">男</text>
					<text class='myInformation_fd1_1_c1_c0_1' v-if="userInfo.gender == '2'">女</text>
					<text class='fu-iconfont2  myInformation_fd1_1_c1_c1' v-if="isSet">&#xE78E;</text>
				</view>
			</view>
			<view class='flex flex-wrap align-center justify-between myInformation_fd1_0' @tap.stop="openBirthday">
				<text class='myInformation_fd1_0_c0'>生日</text>
				<input class='flex-sub myInformation_fd1_2_c1' type="text" placeholder="请选择生日" confirm-type="done"
					:maxlength="30" :disabled='true' placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx"
					v-model="userInfo.birthday" />
				<text class='fu-iconfont2  myInformation_fd1_1_c1_c1' v-if="isSet">&#xE78E;</text>
			</view>
			<view class='flex flex-wrap align-center justify-between myInformation_fd1_0'>
				<text class='myInformation_fd1_0_c0'>手机号</text>
				<!-- <text class='myInformation_fd1_3_c1' v-if="userInfo.id != ''">{{ telAndName.mobile }}</text> -->
				<text class='myInformation_fd1_3_c1_1'>{{ userInfo.mobile }}</text>
			</view>
			<view class='flex flex-wrap align-center justify-between myInformation_fd1_0' @tap.stop="selectDanWei">
				<text class='myInformation_fd1_0_c0'>单位</text>
				<input class='flex-sub myInformation_fd1_2_c1' type="text" placeholder="请输入单位名称" confirm-type="done"
					:disabled="true" :maxlength="7" placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx"
					v-model="danwei_name" />
				<text class='fu-iconfont2  myInformation_fd1_1_c1_c1' v-if="isSet">&#xE78E;</text>
			</view>
			<view class='flex flex-wrap align-center justify-between myInformation_fd1_0' @tap.stop="selectBuMen">
				<text class='myInformation_fd1_0_c0'>部门</text>
				<input class='flex-sub myInformation_fd1_2_c1' type="text" placeholder="请输入部门名称" confirm-type="done"
					:disabled="true" :maxlength="7" placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx"
					v-model="bumen_name" />
				<text class='fu-iconfont2  myInformation_fd1_1_c1_c1' v-if="isSet">&#xE78E;</text>
			</view>
			<view class='flex flex-wrap align-center justify-between myInformation_fd1_0' @tap.stop="selectBanZu">
				<text class='myInformation_fd1_0_c0'>班组</text>
				<input class='flex-sub myInformation_fd1_2_c1' type="text" placeholder="请输入班组名称" confirm-type="done"
					:disabled="true" :maxlength="7" placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx"
					v-model="banzu_name" />
				<text class='fu-iconfont2  myInformation_fd1_1_c1_c1' v-if="isSet">&#xE78E;</text>
			</view>
			<view class='flex flex-wrap align-center justify-between myInformation_fd1_0' @tap.stop="openName">
				<text class='myInformation_fd1_0_c0'>姓名</text>
				<input class='flex-sub myInformation_fd1_2_c1' type="text" placeholder="请输入姓名" :maxlength="10"
					:disabled="true" placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx"
					v-model="userInfo.real_name" />
				<text class='fu-iconfont2  myInformation_fd1_1_c1_c1' v-if="isSet">&#xE78E;</text>
			</view>
			<view style="height: 24rpx;"></view>
			<view class='flex flex-direction flex-wrap align-stretch myInformation_fd1_8'>
				<view class='flex flex-wrap align-center myInformation_fd1_8_c0'>
					<text class='myInformation_fd1_8_c0_c0'>身份证人像照
					</text>
				</view>
				<view class='flex flex-wrap align-center'>
					<view class="upload position-relative">
						<text v-if="fd1_8_c1_c0 != '' && isSet" @tap="fd1_8_c1_c0 = ''"
							class='fu-iconfont2 position-absolute myInformation_fd1_8_c1_c0_icon'>&#xE8E7;</text>
						<image v-if="fd1_8_c1_c0" @tap.stop="previewImage(fd1_8_c1_c0)"
							class=" myInformation_fd1_8_c1_c0_image" mode="aspectFill" :src="fd1_8_c1_c0"></image>
						<image v-if="!fd1_8_c1_c0 && isSet" class=" myInformation_fd1_8_c1_c0_image" mode="aspectFit"
							@tap="soloChooseImage('fd1_8_c1_c0id', 'fd1_8_c1_c0', false, false)"
							:src="STATIC_URL + '14.png'"></image>
						<image v-if="!fd1_8_c1_c0 && !isSet" class=" myInformation_fd1_8_c1_c0_image" mode="aspectFit"
							:src="STATIC_URL + '14.png'"></image>
					</view>
				</view>
			</view>
			<view class='flex flex-direction flex-wrap align-stretch myInformation_fd1_8'>
				<view class='flex flex-wrap align-center myInformation_fd1_8_c0'>
					<text class='myInformation_fd1_8_c0_c0'>身份证国徽照
					</text>
				</view>
				<view class='flex flex-wrap align-center'>
					<view class="upload position-relative">
						<text v-if="fd1_9_c1_c0 != '' && isSet" @tap="fd1_9_c1_c0 = ''"
							class='fu-iconfont2 position-absolute myInformation_fd1_8_c1_c0_icon'>&#xE8E7;</text>
						<image v-if="fd1_9_c1_c0" @tap.stop="previewImage(fd1_9_c1_c0)"
							class=" myInformation_fd1_8_c1_c0_image" mode="aspectFill" :src="fd1_9_c1_c0"></image>
						<image v-if="!fd1_9_c1_c0 && isSet" class=" myInformation_fd1_8_c1_c0_image" mode="aspectFit"
							@tap="soloChooseImage('fd1_9_c1_c0id', 'fd1_9_c1_c0', false, false)"
							:src="STATIC_URL + '15.png'"></image>
						<image v-if="!fd1_9_c1_c0 && !isSet" class=" myInformation_fd1_8_c1_c0_image" mode="aspectFit"
							:src="STATIC_URL + '15.png'"></image>
					</view>
				</view>
			</view>
			<view class='flex flex-direction flex-wrap align-stretch myInformation_fd1_8'>
				<view class='flex flex-wrap align-center myInformation_fd1_8_c0'>
					<text class='myInformation_fd1_8_c0_c0'>学历证书
					</text>
				</view>
				<view class='flex flex-wrap align-center'>
					<view class="upload position-relative">
						<text v-if="fd1_10_c1_c0 != '' && isSet" @tap="fd1_10_c1_c0 = ''"
							class='fu-iconfont2 position-absolute myInformation_fd1_8_c1_c0_icon'>&#xE8E7;</text>
						<image v-if="fd1_10_c1_c0" @tap.stop="previewImage(fd1_10_c1_c0)"
							class=" myInformation_fd1_8_c1_c0_image" mode="aspectFill" :src="fd1_10_c1_c0"></image>
						<image v-if="!fd1_10_c1_c0 && isSet" class=" myInformation_fd1_8_c1_c0_image" mode="aspectFit"
							@tap="soloChooseImage('fd1_10_c1_c0id', 'fd1_10_c1_c0', false, false)"
							:src="STATIC_URL + '16.png'"></image>
						<image v-if="!fd1_10_c1_c0 && !isSet" class=" myInformation_fd1_8_c1_c0_image" mode="aspectFit"
							:src="STATIC_URL + '16.png'"></image>
					</view>
				</view>
			</view>
			<view class='flex flex-direction flex-wrap align-stretch myInformation_fd1_8'>
				<view class='flex flex-wrap align-center myInformation_fd1_8_c0'>
					<text class='myInformation_fd1_8_c0_c0'>资格证件</text>
				</view>
				<!-- <view class='flex flex-wrap align-center justify-between'>
					<view class="upload position-relative">
						<text v-if="fd1_11_c1_c0 != ''" @tap="fd1_11_c1_c0 = ''"
							class='fu-iconfont2 position-absolute myInformation_fd1_8_c1_c0_icon'>&#xE8E7;</text>
						<image class=" myInformation_fd1_11_c1_c0_image" mode="aspectFit"
							@tap="soloChooseImage('fd1_11_c1_c0id', 'fd1_11_c1_c0', false, false)"
							:src="fd1_11_c1_c0 ? fd1_11_c1_c0 : STATIC_URL + '16.png'"></image>
					</view>
				</view> -->
				<block v-if="isSet">
					<view class='flex flex-direction flex-wrap align-stretch'>
						<benben-images-upload ref="benbenImagesUploadfd1_3_c1_c0" :img-list.sync="imgs"
							:img-ids.sync="thumb" :is-show-tips='true' :maxlength="3">
							<template #content="{ num, maxlength, isShow, imgList }">
								<view class="flex flex-wrap align-start flex feedBack1666772448_fd1_3_c1_c0">

									<view v-for="(image, index) in imgList" :key="index"
										class='flex position-relative feedBack1666772448_fd1_3_c1_c00'>
										<text class='fu-iconfont2 position-absolute feedBack1666772448_fd1_3_c1_c000'
											@tap.stop="$refs.benbenImagesUploadfd1_3_c1_c0.delImage(index)">&#xE8E7;</text>
										<image class='feedBack1666772448_fd1_3_c1_c001'
											@tap.stop="$refs.benbenImagesUploadfd1_3_c1_c0.previewImage(index)"
											mode="aspectFill" :src='image'></image>
									</view>

									<image class='feedBack1666772448_fd1_3_c1_c01'
										@tap.stop="$refs.benbenImagesUploadfd1_3_c1_c0.manyChooseImage()" v-if="isShow"
										mode="aspectFit" :src='STATIC_URL+"16.png"'></image>
								</view>
							</template>
						</benben-images-upload>
					</view>
				</block>
				<block v-if="!isSet">
					<view class='flex flex-direction flex-wrap align-stretch'>
						<view class="flex flex-wrap align-start flex feedBack1666772448_fd1_3_c1_c0">

							<view v-for="(image, index) in imgs" :key="index"
								class='flex position-relative feedBack1666772448_fd1_3_c1_c00'>
								<image class='feedBack1666772448_fd1_3_c1_c001' @tap.stop="previewImage1(index, imgs)"
									mode="aspectFill" :src='image'></image>
							</view>
							<image v-if="imgs.length == 0" class='feedBack1666772448_fd1_3_c1_c01' mode="aspectFit"
								:src='STATIC_URL+"16.png"'></image>
						</view>
					</view>
				</block>
			</view>
			<!-- <button class='myInformation_fd1_12' @tap.stop="setUserInfoFunc()" v-if="isSet === true">保存</button> -->
		</view>


		<!--选择性别开始 -->
		<benben-picker ref="benbenWritePickerCodepicker2" :visible.sync="pickerDiy1683966462102"
			:value.sync='userInfo.gender' :options='sex_options' mode='selector' :mask-show='true' :timeout='true'
			:picker-height='88' default-type='value' :default-props='{ "label": "name", "value": "value" }'>
			<template #picker-header>
				<view class='flex flex-wrap align-center justify-between myInformation_picker2_0'>
					<text @tap="$refs.benbenWritePickerCodepicker2.cancel()">取消</text>
					<text>选择性别</text>
					<text class='myInformation_picker2_0_c2'
						@tap="$refs.benbenWritePickerCodepicker2.pickerConfirm()">确认</text>
				</view>
			</template>
		</benben-picker>
		<!--选择性别结束 -->
		<!--选择日期开始 -->
		<benben-picker ref="benbenWritePickerCodepicker3" :visible.sync="pickerDiy1684137696643"
			:value.sync='userInfo.birthday' mode='date' :picker-height='88' :current='true' :mask-show='true'
			fields='day' :timeout='true' start-year='1950-01-01' end-year='现在'>
			<template #picker-header>
				<view class='flex flex-wrap align-center justify-between myInformation_picker3_0'>
					<text @tap="$refs.benbenWritePickerCodepicker3.cancel()">取消</text>
					<text>选择生日</text>
					<text class='myInformation_picker3_0_c2'
						@tap="$refs.benbenWritePickerCodepicker3.pickerConfirm()">确认</text>
				</view>
			</template>
		</benben-picker>
		<!--选择日期结束 -->

		<!--单位选择器开始 -->
		<benben-picker ref="benbenWritePickerCodepicker4" :visible.sync="pickerDiy1687224985189"
			:label.sync='danwei_name' :value.sync='danwei_id' :options='danwei' mode='selector' :mask-show='true'
			:timeout='true' :picker-height='88' default-type='aid' :default-props='{"label":"name","value":"aid"}'
			@change="danweiChange">
			<template #picker-header>
				<view class='flex flex-wrap align-center justify-between next_picker4_0'>
					<text @tap="$refs.benbenWritePickerCodepicker4.cancel()">取消</text>
					<text>选择单位</text>
					<text class='next_picker4_0_c2' @tap="$refs.benbenWritePickerCodepicker4.pickerConfirm()">确认</text>
				</view>
			</template>
		</benben-picker>
		<!--单位选择器结束 -->
		<!--部门选择器开始 -->
		<benben-picker ref="benbenWritePickerCodepicker5" :visible.sync="pickerDiy1687225109942"
			:label.sync='bumen_name' :value.sync='bumen_id' :options='bumen' mode='selector' :mask-show='true'
			:timeout='true' :picker-height='88' default-type='aid' :default-props='{"label":"name","value":"aid"}'
			@change="bumenChange">
			<template #picker-header>
				<view class='flex flex-wrap align-center justify-between next_picker5_0'>
					<text @tap="$refs.benbenWritePickerCodepicker5.cancel()">取消</text>
					<text>部门</text>
					<text class='next_picker5_0_c2' @tap="$refs.benbenWritePickerCodepicker5.pickerConfirm()">确认</text>
				</view>
			</template>
		</benben-picker>
		<!--部门选择器结束 -->
		<!--班组选择器开始 -->
		<benben-picker ref="benbenWritePickerCodepicker6" :visible.sync="pickerDiy1687224596186"
			:label.sync='banzu_name' :value.sync='banzu_id' :options='banzu' mode='selector' :mask-show='true'
			:timeout='true' :picker-height='88' default-type='aid' :default-props='{"label":"name","value":"aid"}'>
			<template #picker-header>
				<view class='flex flex-wrap align-center justify-between next_picker6_0'>
					<text @tap="$refs.benbenWritePickerCodepicker6.cancel()">取消</text>
					<text>班组</text>
					<text class='next_picker6_0_c2' @tap="$refs.benbenWritePickerCodepicker6.pickerConfirm()">确认</text>
				</view>
			</template>
		</benben-picker>
		<!--班组选择器结束 -->
	</view>
</template>
<script>
	import UploadImage from '@/common/utils/upload-image.js'
	// import permision from "@/common/utils/permission.js" // 权限提醒
	import {
		validate
	} from '@/common/utils/validate.js'
	// import determine from "@/common/mixin/determine.js"
	export default {
		// mixins: [determine],
		components: {},
		data() {
			return {
				"pickerDiy1687224596186": false,
				"pickerDiy1687225109942": false,
				"pickerDiy1687224985189": false,
				"pickerDiy1684137696643": false,
				"pickerDiy1683966462102": false,
				"fd1_0_c1id": "",
				"fd1_8_c1_c0": "",
				"fd1_8_c1_c0id": "",
				"fd1_9_c1_c0": "",
				"fd1_9_c1_c0id": "",
				"fd1_10_c1_c0": "",
				"fd1_10_c1_c0id": "",
				"fd1_11_c1_c0": "",
				"fd1_11_c1_c0id": "",
				"thumb": "",
				"imgs": [],
				"userInfo": {
					"invite_code": "",
					"address": "",
					"address_code": "",
					"address_citycode": "",
					"id": "",
					"lastid": "",
					"user_nickname": "",
					"mobile": "",
					"user_name": "",
					"head_img": "",
					"birthday": "",
					"is_finger": "",
					"user_money": "",
					"freeze_money": "",
					"withdrawal_money": "",
					"score": "",
					"empirical": "",
					"invoice_title": "",
					"invoice_company_title": "",
					"total_consumption_money": "",
					"sex": "",
					"create_time": "",
					"phone": "",
					"online": "",
					"_mobile": "",
					"coupon": "",
					"age": "",
					"collection_count": "",
					"browse_count": "",
					"certified": "",
					"invite": [],
					"nvq": [],
				},
				"sex_options": [{
					"name": "保密",
					"value": "0",
					"image": ""
				}, {
					"name": "男",
					"value": "1",
					"image": ""
				}, {
					"name": "女",
					"value": "2",
					"image": ""
				}],
				"user": {
					"userinfo": {
						"id": "",
						"avatar": "",
						"real_name": "",
						"nickname": "",
						"email": "",
						"gender": "",
						"mobile": "",
						"birthday": "",
						"client_id": "",
						"phone": ""
					}
				},
				"isSet": false,
				"telAndName": {
					"mobile": "",
					"name": ""
				},
				"danwei": [],
				"danwei_name": "",
				"danwei_id": "",
				"bumen": [],
				"bumen_name": "",
				"bumen_id": "",
				"banzu": [],
				"banzu_name": "",
				"banzu_id": "",
				"level": '1', // 1单位 2部门 3班组
				"pid": "", // 每级的id
				"is_camera": 0,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.queryUserInfoFunc();
			this.diyPageListen();
			this.getUnit();
		},
		onUnload() {
			this.diyOffPageListen()
		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取用户详细信息
			async queryUserInfoFunc() {
				//请求方法
				//数据验证

				let datauserInfo = await this.$api.post(global.apiUrls.post5c78c4772da97, {

				});

				if (datauserInfo.data.code != 1) {
					this.$message.info(datauserInfo.data.msg);
					return
				}
				let infouserInfo = datauserInfo.data;
				this.userInfo = infouserInfo.data;
				this.fd1_8_c1_c0 = this.userInfo.idcard_portrait;
				this.fd1_9_c1_c0 = this.userInfo.idcard_emblem;
				this.fd1_10_c1_c0 = this.userInfo.diploma;
				this.imgs = this.userInfo.nvq;
				this.danwei_name = this.userInfo.danwwei;
				this.danwei_id = this.userInfo.danwei_id;
				this.bumen_name = this.userInfo.bumen;
				this.bumen_id = this.userInfo.bumen_id;
				this.banzu_name = this.userInfo.group;
				this.banzu_id = this.userInfo.group_id;
			},
			//修改用户资料
			async setUserInfoFunc() {
				if (!this.danwei_name) {
					this.$message.info('请选择单位');
					return;
				}
				if (!this.bumen_name) {
					this.$message.info('请选择部门');
					return;
				}
				if (!this.banzu_name) {
					this.$message.info('请选择部门');
					return;
				}
				//请求方法
				//数据验证
				let datauser = await this.$api.post(global.apiUrls.post5cb54af125f1c, {
					avatar: this.userInfo.avatar,
					gender: this.userInfo.gender,
					birthday: this.userInfo.birthday,
					idcard_portrait: this.fd1_8_c1_c0,
					idcard_emblem: this.fd1_9_c1_c0,
					diploma: this.fd1_10_c1_c0,
					real_name: this.userInfo.real_name,
					nvq: this.imgs.length > 0 ? this.imgs.join(',') : '',
					unitsmanager_id: this.danwei_id + ',' + this.bumen_id + ',' + this.banzu_id,
				});

				if (datauser.data.code != 1) {
					this.$message.info(datauser.data.msg);
					return
				}
				this.$message.info(datauser.data.msg);
				let infouser = datauser.data;
				this.user = infouser.data;
				setTimeout(() => {
					uni.navigateBack();
				}, 800)
			},
			// 选择单位  post647af4c7c4164
			getUnit() {
				this.$api.post(global.apiUrls.post647af4c7c4164, {
					level: this.level,
					pid: this.pid
				}).then(res => {
					// console.log(res);
					if (res.data.code == 1) {
						if (this.level == 1) {
							this.danwei = res.data.data;
						} else if (this.level == 2) {
							this.bumen = res.data.data;
						} else if (this.level == 3) {
							this.banzu = res.data.data;
						}
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			selectDanWei() {
				if (!this.isSet) {
					return;
				}
				this.pickerDiy1687224985189 = true;
			},
			// 选择单位
			danweiChange() {
				this.pid = this.danwei_id;
				this.level = 2;
				this.bumen_name = "";
				this.bumen_id = "";
				this.banzu_name = "";
				this.banzu_id = "";
				this.getUnit();
			},
			selectBuMen() {
				if (!this.isSet) {
					return;
				}
				if (!this.danwei_name) {
					this.$message.info('请选择单位');
					return;
				}
				this.pid = this.danwei_id;
				this.level = 2;
				this.getUnit();
				this.pickerDiy1687225109942 = true;
			},
			bumenChange() {
				this.pid = this.bumen_id;
				this.level = 3;
				this.banzu_name = "";
				this.banzu_id = "";
				this.getUnit();
			},
			selectBanZu() {
				if (!this.isSet) {
					return;
				}
				if (!this.danwei_name) {
					this.$message.info('请选择单位');
					return;
				}
				if (!this.bumen_name) {
					this.$message.info('请选择部门');
					return;
				}
				this.pid = this.bumen_id;
				this.level = 3;
				this.getUnit();
				this.pickerDiy1687224596186 = true;
			},


			openSex() {
				if (this.isSet) {
					this.pickerDiy1683966462102 = true;
				}
			},
			openBirthday() {
				if (this.isSet) {
					this.pickerDiy1684137696643 = true;
				}
			},
			openName() {
				if (this.isSet) {
					uni.navigateTo({
						url: '/pages/main/setMobileAndName/setMobileAndName?type=2&name=' + this.userInfo.real_name
					})
				}
			},
			//裁剪图片上传
			croppingUploadImage(id, path, obj, obj1, fnName = false) {
				if (uni.getStorageSync('is_camera') == 0) {
					let self = this
					uni.showModal({
						title: '提示',
						content: '访问您的相机或相册权限，使用拍照或选择照片功能，用于上传头像或上传图片，是否允许？',
						success: function(res) {
							if (res.confirm) {
								console.log('用户点击确定');
								uni.setStorageSync('is_camera', 1);
								if (!obj) obj = this
								if (!obj1) obj1 = this
								let itemList = obj1[path] ? ['修改头像', '拍照', '从手机相册选择'] : ['拍照',
									'从手机相册选择'
								]
					
								function imageCroppingCuccess() {
									uni.$once('image-cropping-success', (file) => {
										if (!file) return
										new UploadImage([file], {
											complete: (res) => {
												if (id) self.$set(obj, id, res[
													0].id)
												if (path) self.$set(obj1, path,
													res[0].path)
												if (fnName) self[fnName]()
											},
										})
									})
								}
								uni.showActionSheet({
									itemList: itemList,
									success: function(res) {
										if (res.tapIndex == 0 && obj1[path]) {
											uni.navigateTo({
												url: '/pages/benben-built-in/image-cropping/image-cropping?rectHeight=200&rectWidth=200&&myImgUrl=' +
													obj1[path],
												animationDuration: 0,
											})
											imageCroppingCuccess()
										}
										if ((res.tapIndex == 1 && obj1[path]) || (res
												.tapIndex == 0 && !obj1[
													path])) {
											uni.chooseImage({
												count: 1,
												sizeType: ['original',
													'compressed'
												], // 可以指定是原图还是压缩图，默认二者都有
												sourceType: [
													'camera'
												], // 可以指定来源是相册还是相机，默认二者都有
												success: (res) => {
													// 跳转到图片裁切页面
													uni.navigateTo({
														url: `/pages/benben-built-in/image-cropping/image-cropping?rectHeight=200&rectWidth=200&fileType=${res.tempFiles[0].type}&myImgUrl=${res.tempFilePaths[0]}`,
														animationDuration: 0,
													})
													imageCroppingCuccess()
												},
											})
										}
										if ((res.tapIndex == 2 && obj1[path]) || (res
												.tapIndex == 1 && !obj1[
													path])) {
											uni.chooseImage({
												count: 1,
												sizeType: ['original',
													'compressed'
												], // 可以指定是原图还是压缩图，默认二者都有
												sourceType: [
													'album'
												], // 可以指定来源是相册还是相机，默认二者都有
												success: (res) => {
													// 跳转到图片裁切页面
													uni.navigateTo({
														url: `/pages/benben-built-in/image-cropping/image-cropping?rectHeight=200&rectWidth=200&fileType=${res.tempFiles[0].type}&myImgUrl=${res.tempFilePaths[0]}`,
														animationDuration: 0,
													})
													imageCroppingCuccess()
												},
											})
										}
									},
									fail: function(res) {
										console.log(res.errMsg)
									},
								})
							} else if (res.cancel) {
								console.log('用户点击取消');
							}
						},
						fail: function(err) {
							console.log(err);
						}
					})
				} else {
					let self = this
					if (!obj) obj = this
					if (!obj1) obj1 = this
					let itemList = obj1[path] ? ['修改头像', '拍照', '从手机相册选择'] : ['拍照',
						'从手机相册选择'
					]
					
					function imageCroppingCuccess() {
						uni.$once('image-cropping-success', (file) => {
							if (!file) return
							new UploadImage([file], {
								complete: (res) => {
									if (id) self.$set(obj, id, res[
										0].id)
									if (path) self.$set(obj1, path,
										res[0].path)
									if (fnName) self[fnName]()
								},
							})
						})
					}
					uni.showActionSheet({
						itemList: itemList,
						success: function(res) {
							if (res.tapIndex == 0 && obj1[path]) {
								uni.navigateTo({
									url: '/pages/benben-built-in/image-cropping/image-cropping?rectHeight=200&rectWidth=200&&myImgUrl=' +
										obj1[path],
									animationDuration: 0,
								})
								imageCroppingCuccess()
							}
							if ((res.tapIndex == 1 && obj1[path]) || (res
									.tapIndex == 0 && !obj1[
										path])) {
								uni.chooseImage({
									count: 1,
									sizeType: ['original',
										'compressed'
									], // 可以指定是原图还是压缩图，默认二者都有
									sourceType: [
										'camera'
									], // 可以指定来源是相册还是相机，默认二者都有
									success: (res) => {
										// 跳转到图片裁切页面
										uni.navigateTo({
											url: `/pages/benben-built-in/image-cropping/image-cropping?rectHeight=200&rectWidth=200&fileType=${res.tempFiles[0].type}&myImgUrl=${res.tempFilePaths[0]}`,
											animationDuration: 0,
										})
										imageCroppingCuccess()
									},
								})
							}
							if ((res.tapIndex == 2 && obj1[path]) || (res
									.tapIndex == 1 && !obj1[
										path])) {
								uni.chooseImage({
									count: 1,
									sizeType: ['original',
										'compressed'
									], // 可以指定是原图还是压缩图，默认二者都有
									sourceType: [
										'album'
									], // 可以指定来源是相册还是相机，默认二者都有
									success: (res) => {
										// 跳转到图片裁切页面
										uni.navigateTo({
											url: `/pages/benben-built-in/image-cropping/image-cropping?rectHeight=200&rectWidth=200&fileType=${res.tempFiles[0].type}&myImgUrl=${res.tempFilePaths[0]}`,
											animationDuration: 0,
										})
										imageCroppingCuccess()
									},
								})
							}
						},
						fail: function(res) {
							console.log(res.errMsg)
						},
					})
				}

			},
			//上传单图、多图方法
			soloChooseImage(id, path, obj, obj1, fnName = false) {
				if (uni.getStorageSync('is_camera') == 0) {
					let self = this
					uni.showModal({
						title: '提示',
						content: '访问您的相机或相册权限，使用拍照或选择照片功能，用于上传头像或上传图片，是否允许？',
						success: function(res) {
							if (res.confirm) {
								console.log('用户点击确定');
								uni.setStorageSync('is_camera', 1);
								if (!obj) obj = this
								if (!obj1) obj1 = this
								if (self.uploading) {
									return
								}
								// 从相册中选择图片
								uni.chooseImage({
									count: 1, // 默认3
									sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
									success: function(res) {
										self.uploading = true
										// 开始上传
										new UploadImage(res.tempFiles, {
											complete: function(res) {
												// console.log('res------------------------------------------',res);
												self.uploading = false
												if (id) self.$set(obj, id, res[0].id)
												if (path) self.$set(obj1, path, res[0].path)
												if (fnName) self[fnName]()
											},
										})
									},
								})
							} else if (res.cancel) {
								console.log('用户点击取消');
							}
						},
						fail: function(err) {
							console.log(err);
						}
					})
				} else {
					let self = this
					if (!obj) obj = this
					if (!obj1) obj1 = this
					if (self.uploading) {
						return
					}
					// 从相册中选择图片
					uni.chooseImage({
						count: 1, // 默认3
						sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
						success: function(res) {
							self.uploading = true
							// 开始上传
							new UploadImage(res.tempFiles, {
								complete: function(res) {
									// console.log('res------------------------------------------',res);
									self.uploading = false
									if (id) self.$set(obj, id, res[0].id)
									if (path) self.$set(obj1, path, res[0].path)
									if (fnName) self[fnName]()
								},
							})
						},
					})
				}
			},

			previewImage(url) {
				let arr = [];
				arr.push(url);
				uni.previewImage({
					current: 0, // 当前显示图片的索引值
					urls: arr // 需要预览的图片列表，photoList要求必须是数组
				})
			},
			previewImage1(index, urls) {
				uni.previewImage({
					current: index,
					urls: urls
				})
			},

			//编辑
			setFunc() {
				this.isSet = true;
			},
			//页面监听
			diyPageListen() {
				uni.$on('telAndName', (data) => {
					this.userInfo.real_name = data;
				});
			},
			//注销页面监听
			diyOffPageListen() {
				uni.$off('telAndName');
			}
		}
	};
</script>
<style lang="scss" scoped>
	.next_picker4_0_c2 {
		color: rgba(181, 143, 104, 1);
	}

	.next_picker4_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
		border-radius: 25rpx 25rpx 0rpx 0rpx;
		background-size: 100% auto !important;
	}

	.next_picker5_0_c2 {
		color: rgba(202, 176, 149, 1);
	}

	.next_picker5_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
		border-radius: 25rpx 25rpx 0rpx 0rpx;
		background-size: 100% auto !important;
	}

	.next_picker6_0_c2 {
		color: rgba(202, 176, 149, 1);
	}

	.next_picker6_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
		border-radius: 25rpx 25rpx 0rpx 0rpx;
		background-size: 100% auto !important;
	}


	.feedBack1666772448_fd1_3_c1_c02 {
		font-size: 24rpx;
		color: rgba(191, 191, 191, 1);
		font-weight: 400;
		width: 100%;
	}

	.feedBack1666772448_fd1_3_c1_c01 {
		width: 334rpx;
		height: 216rpx;
		// margin: 8rpx 0rpx 8rpx 0rpx;
		border-radius: 8rpx;
		margin-bottom: 16rpx;
	}

	.feedBack1666772448_fd1_3_c1_c001 {
		width: 334rpx;
		height: 216rpx;
		border-radius: 8rpx;
		margin-bottom: 16rpx;
	}

	.feedBack1666772448_fd1_3_c1_c000 {
		top: 0rpx;
		right: 0rpx;
		z-index: 10;
		color: #ff5536;
	}

	.feedBack1666772448_fd1_3_c1_c00 {
		// margin: 0rpx 24rpx 24rpx 0rpx;
	}

	.feedBack1666772448_fd1_3_c1_c0 {
		padding: 24rpx 0rpx 24rpx 0rpx;
		justify-content: space-between;
	}

	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: var(--benbenbgColor1);
		background-size: 100% auto !important;
	}

	.myInformation_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.myInformation_fd0_0_c2_c0 {
		color: #333333;
		font-size: 28rpx;
		font-weight: 500;
		line-height: 50rpx;
	}

	.myInformation_fd0_0_c2 {
		height: 50rpx;
	}

	.myInformation_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		line-height: 88rpx;
	}

	.myInformation_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
	}

	.myInformation_fd0_0_c0 {
		width: 50rpx;
		height: 50rpx;
	}

	.myInformation_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.myInformation_flex_1 {
		background: #fff;
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.myInformation_fd1_12 {
		background: #4781f5;
		border-radius: 180rpx 180rpx 180rpx 180rpx;
		font-size: 32rpx;
		color: #fff;
		height: 88rpx;
		line-height: 88rpx;
		margin: 45rpx 0rpx 45rpx 0rpx;
	}

	.myInformation_fd1_11_c1_c0_image {
		width: 334rpx;
		height: 216rpx;
	}

	.myInformation_fd1_8_c1_c0_image {
		width: 400rpx;
		height: 252rpx;
		border-radius: 8rpx;
	}

	.myInformation_fd1_8_c1_c0_icon {
		top: 0rpx;
		right: 0rpx;
		z-index: 1;
		color: #ff5536;
	}

	.myInformation_fd1_8_c0_c0 {
		color: #000000;
		font-size: 32rpx;
		font-weight: 700;
		line-height: 52rpx;
	}

	.myInformation_fd1_8_c0 {
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.myInformation_fd1_8 {
		margin: 0rpx 0rpx 32rpx 0rpx;
	}

	.myInformation_fd1_3_c1_1 {
		font-size: 32rpx;
		font-weight: 400;
		color: rgba(102, 102, 102, 1);
		max-width: 400rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}

	.myInformation_fd1_3_c1 {
		font-size: 32rpx;
		font-weight: 400;
		color: rgba(153, 153, 153, 1);
		max-width: 400rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}

	.myInformation_fd1_2_c1 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
		text-align: right;
		margin: 0rpx 0rpx 0rpx 48rpx;
	}

	.myInformation_fd1_1_c1_c1 {
		font-size: 28rpx;
		margin: 0rpx 0rpx 0rpx 14rpx;
	}

	.myInformation_fd1_1_c1_c0_1 {
		font-size: 32rpx;
		color: var(--benbenFontColor1);
		text-align: right;
	}

	.myInformation_fd1_1_c1_c0 {
		font-size: 32rpx;
		color: rgba(153, 153, 153, 1);
		text-align: right;
	}

	.myInformation_fd1_0_c1_image {
		width: 100rpx;
		height: 100rpx;
		border-radius: 50rpx 50rpx 50rpx 50rpx;
	}

	.myInformation_fd1_0_c0 {
		font-size: 32rpx;
		font-weight: 400;
		color: rgba(51, 51, 51, 1);
	}

	.myInformation_fd1_0 {
		border-bottom: 1px solid #eee;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.myInformation_picker2_0_c2 {
		color: rgba(205, 150, 45, 1);
	}

	.myInformation_picker2_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
		border-radius: 25rpx 25rpx 0rpx 0rpx;
		background-size: 100% auto !important;
	}

	.myInformation_picker3_0_c2 {
		color: rgba(205, 150, 45, 1);
	}

	.myInformation_picker3_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
		border-radius: 25rpx 25rpx 0rpx 0rpx;
		background-size: 100% auto !important;
	}
</style>